package com.pn.mapper;

import com.github.pagehelper.Page;
import com.pn.entity.Client;
import com.pn.entity.Store;
import com.pn.entity.Supply;
import com.pn.utils.Result;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Mapper
public interface SupplyMapper {

    Page<Supply> supplyPageList(Supply supply);

    //修改供货商
    int supplyUpdate(Supply supply);

    //添加供货商
    @Insert("insert into supply values (null,#{supplyNum},#{supplyName},#{supplyIntroduce},#{concat},#{phone}," +
            "#{address},#{isDelete})")
    int supplyInsert(Supply supply);

    //删除供货商
    @Update("update supply set is_delete = 1 where supply_id = #{supplyId}")
    int supplyDelete(Integer supplyId);

    //显示供货商
    @Select("select * from supply where is_delete = 0")
    List<Supply> supplyList();

    //查看供货商编号是否存在
    @Select("select * from supply where supply_num = #{supplyNum1}")
    List<Supply> supplyNumCheck(String supplyNum1);

}
